package com.twu.biblioteca.controller;

import com.twu.biblioteca.BibliotecaApp;

import java.util.Scanner;

/**
 * Created by andreas on 21.04.14.
 */
public class MainMenuController extends AbstractController implements Controller {

    public MainMenuController(Scanner reader, BibliotecaApp app) {
        super(reader, app);
        printInstructions();
        handleUserInput();
    }

    private void printInstructions() {
        println("");
        println("Choose one of the following options:\n[Books] List available books\n[Movies] List available movies\n[My Books] Show books currently booked by myself\n[User Information]See my user information\n[Quit] quit.");
        println("");
    }

    @Override
    public void doHandleUserInput(String input) {
        switch (input) {
            case "Books":
                goTo(Place.BOOK_LIST);
                break;
            case "Movies":
                goTo(Place.MOVIE_LIST);
                break;
            case "Quit":
                handleUserInput = false;
                println("Have a nice day!");
                break;
            case "My Books":
                goTo(Place.MY_BOOKS);
                break;
            case "User Information":
                goTo(Place.USER_INFORMATION);
            default:
                println("Select a valid option!\n");
        }
    }

}
